import {createStore} from "redux";

interface IAction {
    type:string,
    payload?:any
}

const reducer = (prevState={
    tabbarShow: true
}, action:IAction) => {
    const {type} = action
    const  newState = {...prevState}
    switch (type){
        case 'show':
            newState.tabbarShow = true
            return newState
        case 'hide':
            newState.tabbarShow = false
            return newState
        default:
            return prevState
    }
}

const store = createStore(reducer)

export default store